<!DOCTYPE html>
<html ng-app="myApp">
	<head>
		<meta charset="UTF-8">
		<title>路由参数的传递</title>
		<script src="../AngularJS-1.4.1/js/angular.js"></script>
		<script src="../AngularJS-1.4.1/js/angular-route.js"></script>
	</head>
	<body ng-controller="indexCtrl">
		
		
		<!--接收容器-->
		<div ng-view></div>
		
	</body>
	<script type="text/javascript">
//		申明一个模块	
		var app=angular.module('myApp',['ng','ngRoute'])
		
		//配置路由词典
		app.config(function($routeProvider){
			$routeProvider
				.when('/myCheck',{
					templateUrl:'tpl/check.html'
				})
				.when('/myPay',{
					templateUrl:'tpl/pay.html'
				})
//				接受方的路由
				.when('/myPay/:price',{
					templateUrl:'tpl/pay.html',
					controller:'payCtrl'
				})
				
				.when('/mySend',{
					templateUrl:'tpl/send.html'
				})
				.otherwise({
					redirectTo:'/myCheck'
				})
			
		})
		
		
//		首页跳转控制器
		app.controller('indexCtrl',['$scope','$location',function($scope,$location){
			$scope.jump = function(url){
				$location.path(url);
			}
			
		}])
		
//		pay的控制器
		app.controller('payCtrl',['$scope','$routeParams',function($scope,$routeParams){
			$scope.getprice=$routeParams.price;
			
		}])
			
			
			
			
	</script>
	
	
</html>
